home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15611 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Parsing filenames
  5. Date: 20 Apr 1996 06:05:00 GMT
  6. Organization: systems hk
  7. Message-ID: <4l9uqc$2ce@nadine.teleport.com>
  8. References: <3176CFFD.6723@central.co.nz>
  9. NNTP-Posting-Host: ip-pdx18-35.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. Alan Howard <duck@central.co.nz> wrote:
  16. >I am copying shareware files from a CD to a HDD to compile a CD-R of my 
  17. >own full of back-up info.  The files in question are ex Amiga 1200 an all 
  18. >have long filenames full of illegal spaces (0x20) and asterisks...
  19. >MS-Dos truncates the long filenames into 8.3 but leaves duplicates in 
  20. >each dir ie, 'robots in the park' and 'robots in the garden' both convert 
  21. >to 'robots i'.
  22. [snip]
  23. >Can anyone help me get around this problem.  How do I open an illegally 
  24. >named file and then transfer the data associated with it from A to B???
  25. >How are the dir entries formatted, How can I find a specific entry, look 
  26. >in it, find the beginning cluster for an arbitrary file, convert this 
  27. >info to C function calls and shift the data??????
  28. >
  29. Alan,
  30.  
  31. My advice would be to lose the original names, because you'll spend
  32. most of your time trying to encode them to readable 8.3 alternatives.
  33.  
  34. If you can get each file open, then open it, create a new file with
  35. a unique name (increment a counter?), copy the contents from the
  36. original to the new file (byte by byte, in binary mode), close both
  37. files.
  38.  
  39. Write the original name and new name to a text file, for later decoding.
  40.  
  41. Yours, Geoff Houck
  42.  
  43.